package com.peach.stock.domain;

import java.math.BigDecimal;
import java.util.List;

public class StockModel {

	private String nm;
	
	private String hynm;
	
	private Stock11Model stock11;
	
	private List<Stock12Model> lst;

	/**
	 * 涨跌幅度
	 */
	private BigDecimal percent;
	
	public BigDecimal getPercent() {
		return percent;
	}

	public void setPercent(BigDecimal percent) {
		this.percent = percent;
	}

	public String getNm() {
		return nm;
	}

	public void setNm(String nm) {
		this.nm = nm;
	}

	public String getHynm() {
		return hynm;
	}

	public void setHynm(String hynm) {
		this.hynm = hynm;
	}

	public Stock11Model getStock11() {
		return stock11;
	}

	public void setStock11(Stock11Model stock11) {
		this.stock11 = stock11;
	}

	public List<Stock12Model> getLst() {
		return lst;
	}

	public void setLst(List<Stock12Model> lst) {
		this.lst = lst;
	}

	private static final String SPLIT_1 = "  ";
	
	@Override
	public String toString()
	{
		StringBuffer result = new StringBuffer("------------\r\n");
		result.append(stock11.getDm());
		result.append(SPLIT_1);
		result.append(nm);
		result.append(SPLIT_1);
		result.append(percent);
		result.append(SPLIT_1);
		result.append("行业:");
		result.append(hynm);
		result.append(SPLIT_1);
		result.append("当前价格:");
		result.append(stock11.getClose());
//		result.append(SPLIT_1);
//		result.append("市值:");
//		result.append(stock11.getTcap());
		result.append("\r\n");
		
		if (lst != null)
		{
			for (Stock12Model s12 : lst)
			{
				result.append(s12.getRq());
				result.append(SPLIT_1);
				result.append("净利润:");
				result.append(s12.getJlr());
//				result.append(SPLIT_1);
//				result.append("市盈率:");
//				result.append(stock11.getTcap().divide(s12.getJlr().multiply(new BigDecimal(10000)), 1, BigDecimal.ROUND_HALF_DOWN));
				result.append("\r\n");
			}			
		}

		
		return result.toString();
	}
	
}
